package com.example.friend.controller;

import com.example.api.domain.vo.UserQuestionResultVO;
import com.example.common.core.domain.R;
import com.example.friend.domain.user.dto.UserSubmitDTO;
import com.example.friend.service.IUserQuestionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/question")
@Slf4j
public class UserQuestionController {

    @Autowired
    private IUserQuestionService userQuestionService;

    //用户代码提交   请求方法  地址  参数  响应数据结构
    @PostMapping("/submit")
    public R<UserQuestionResultVO> submit(@RequestBody UserSubmitDTO submitDTO) {
        log.info("/user/question/submit->submitDTO{}", submitDTO);
        return userQuestionService.submit(submitDTO);
    }

}
